package thread;

public class Thread_wait {
    public static void main(String[] args) throws InterruptedException {
        Object object = new Object();
        synchronized (object){//锁对象必须一致
            System.out.println("wait 之前");
            object.wait();//wait()方法是Object类中的方法
            System.out.println("wait 之后");
        }
    }
}
